<?php
namespace app\api\controller;

use app\BaseController;
// use app\Request;
use think\facade\Request;

class User extends BaseController
{
    public function band(Request $request)
    {
        // return 'api/user/band';
        $userip = $request::IP();
        if($userip=='127.0.0.1') return json_encode(['code'=>0,'msg'=>'获取成功','data'=>['area'=>'本地']],JSON_UNESCAPED_UNICODE);
        return json_encode(['code'=>0,'msg'=>'获取成功','data'=>['area'=>'外网']],JSON_UNESCAPED_UNICODE);
    }

    public function hello($name = 'ThinkPHP6')
    {
        return 'hello,' . $name;
    }
}
